﻿package mortal.game.manager
{
    import com.gengine.utils.pools.*;
    import com.mui.display.*;
    import flash.display.*;
    import mortal.component.gconst.*;
    import mortal.game.manager.item.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.effect.*;

    public class EffectManager extends Object
    {
        private static var _glowFilter:GlowFilterEffect = new GlowFilterEffect();
        private static var _uiMaskEffect:UIMaskEffect = new UIMaskEffect();

        public function EffectManager()
        {
            return;
        }// end function

        public static function glowFilterReg(param1:DisplayObject, param2:Array = null, param3:Number = 1, param4:int = 10, param5:int = 0, param6:int = 0, param7:Function = null) : void
        {
            if (param2 == null)
            {
                param2 = [FilterConst.guideTipsFilter];
            }
            _glowFilter.regist(param1, param2, param3, param4, param5, param6, param7);
            return;
        }// end function

        public static function glowFilterUnReg(param1:DisplayObject) : void
        {
            _glowFilter.unRegist(param1);
            return;
        }// end function

        public static function getGlowFilters(param1:DisplayObject) : Array
        {
            return _glowFilter.getFilters(param1);
        }// end function

        public static function getLineBox(param1:int, param2:int, param3:Array = null, param4:Number = 0.5, param5:Number = 1, param6:Number = 1) : LineBox
        {
            var _loc_7:* = ObjectPool.getObject(LineBox);
            if (param3 == null)
            {
                param3 = [16711680, 16776960];
            }
            _loc_7.updateLine(param1, param2, param3, param4, param5, param6);
            return _loc_7;
        }// end function

        public static function disposeLineBox(param1:LineBox) : void
        {
            if (!param1)
            {
                return;
            }
            param1.dispose();
            ObjectPool.disposeObject(param1, LineBox);
            return;
        }// end function

        public static function addUIMask(param1:Array, param2:int = 10000, param3:Number = 0.3, param4:Function = null) : void
        {
            _uiMaskEffect.showMask(param1, param2, param3, param4);
            return;
        }// end function

        public static function hideUIMask() : void
        {
            _uiMaskEffect.hideMask();
            return;
        }// end function

        public static function hasUIMask() : Boolean
        {
            return !_uiMaskEffect.isHide;
        }// end function

        public static function stageResize() : void
        {
            _uiMaskEffect.stageResize();
            return;
        }// end function

        public static function getTaskLightMask(param1:int, param2:int) : ScaleBitmap
        {
            var _loc_3:* = UIFactory.bg(0, 0, param1, param2, null, ImagesConst.taskLightMask);
            _loc_3.filters = [FilterConst.alertGlowFilter];
            return _loc_3;
        }// end function

        public static function getSelectedRect(param1:int, param2:int, param3:int, param4:Number = 0.8) : Sprite
        {
            var _loc_5:Sprite = null;
            _loc_5 = UIFactory.sprite(0, 0);
            _loc_5.graphics.beginFill(param1, param4);
            _loc_5.graphics.drawRoundRect(0, 0, param2, param3, 12, 12);
            _loc_5.graphics.endFill();
            _loc_5.mouseEnabled = false;
            return _loc_5;
        }// end function

    }
}
